home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15290 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  702 b 

  1. Path: uhura.phoenix.net!usenet
  2. From: brucew@phoenix.net (Bruce Wedding)
  3. Newsgroups: comp.lang.c,comp.unix.programmer
  4. Subject: Re: Q: '\n' character
  5. Date: Wed, 17 Apr 1996 22:57:14 GMT
  6. Organization: BranPaul Systems
  7. Message-ID: <4l3ta3$c08@uhura.phoenix.net>
  8. References: <4kj66f$k0o@ren.cei.net> <1996Apr11.192937.25676@sq.com> <829396473snz@genesis.demon.co.uk> <4kpd2g$eeb@masala.cc.uh.edu>
  9. NNTP-Posting-Host: dial22.phoenix.net
  10. X-Newsreader: Moe's Newsreader    
  11.  
  12. In comp.lang.c
  13.  
  14. >: >This leads to the alternative approach:
  15. >: >
  16. >: >  ptr = strchr (buffer, '\n');   /* or strrchr() */
  17. >: >  if (ptr) *ptr = '\0';
  18.  
  19. Which is a lot of code when this will do the same thing:
  20.  
  21. strtok( ptr, "\n");
  22.  
  23. Bruce
  24.  
  25.